package com.ny.test;

public class BankPay implements Pay{
    double m = 1000;

    @Override
    public void pay(double money) {
        if(m>=money){
            System.out.println("银行卡支付:"+money);
            m = m-money;
            System.out.println("你的余额为:"+m);
        }
        else {
            System.out.println("你的余额不足");
        }
    }

    @Override
    public void pay2(double money) {
        if(m>=money){
            System.out.println("微信支付:"+money);
            m=m-money;
            System.out.println("你的余额为:"+m);
        }
        else{
            System.out.println("你的余额不足");
        }
    }

    @Override
    public void pay3(double money) {
        if(m>=money){
            System.out.println("支付宝支付:"+money);
            m=m-money;
            System.out.println("你的余额为:"+m);
        }
        else{
            System.out.println("你的余额不足");
        }
    }
}
